package com.cart.protocol.analyze;


import com.cart.protocol.ProtocolDefine;

/*
    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ 
       Author   :  lixiaodaoaaa
       Date     :  2020-01-17
       Time     :  14:03
    ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 */
public class CultureTankRespAnalyze extends RespAnalyze {

    public CultureTankRespAnalyze(String rawDeviceInfo) {
        super(rawDeviceInfo);
    }

    @Override
    protected RespAnalyze analyze() {
        //读取氧气：10 0402  ff    1000
        //设置氧气：20 0401  bb    400b
        //停止氧气：20 0401  aa    00
        //20 0a02  cc 00
        StringBuilder resultBuilder = new StringBuilder();

        switch (operatorCmd) {
            case ProtocolDefine.OperateCommand.OPEN:
                resultBuilder.append("打开");
                break;
            case ProtocolDefine.OperateCommand.CLOSE:
                resultBuilder.append("关闭");
                break;
            default:
                break;
        }
        resultBuilder.append("培养罐阀门");

        switch (commandWordRes.toUpperCase()) {
            case ProtocolDefine.CommandWordRes.ACTION_SUCCESS:
                resultBuilder.append("成功");
                break;
            case ProtocolDefine.CommandWordRes.ACTION_FAIL:
                resultBuilder.append("失败");
                break;
            default:
                break;
        }
        report = resultBuilder.toString();
        return this;
    }
}
